<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>背景</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .bord{
            border: 1px dashed #ee2602;
            width: 90%;
            margin: 20px auto;
        }
        .title{
            font-size: 20px;
            font-weight: bold;
            margin: 20px;
        }
        .introduce{
            font-size: 16px;
            margin: 0 0 20px 50px;
        }
        .red{
            color: red;
        }
    </style>
</head>
<body>
<div class="bord">
    <div class="title">背景</div>
    <div class="introduce">介绍内容</div>
</div>
<div class="bord">
    <div class="title">背景代码</div>
    <div class="introduce">
        <pre>&lt;style&gt;
        body{
        background-image:url("img/bjt.jpg");
        background-repeat: repeat-x;
        }
        &lt;/style&gt;
    </pre>
     </div>
</div>
<div class="bord">
    <div class="title">背景图片定位</div>
    <div class="introduce">
        <p class="slxg">代码示例1：</p>
        <pre>
    &lt;div style="    width: 20px;
                height: 20px;
                border: 1px solid rebeccapurple;
                background-image:url('../img/tb.png')"&gt;
    &lt;/div&gt;
</pre>
        <div style="    width: 20px;
                height: 20px;
                border: 1px solid rebeccapurple;
                background-image:url('../img/tb.png')">
        </div>
        <p class="slxg">代码示例2：</p>
        <pre>
    &lt;div style="    width: 20px;
                height: 20px;
                border: 1px solid rebeccapurple;
                background-position: 20px 40px;
                background-image:url('../img/tb.png')"&gt;
    &lt;/div&gt;
</pre>
        <div style="    width: 20px;
                height: 20px;
                border: 1px solid rebeccapurple;
                background-position: 20px 40px;
                background-image:url('../img/tb.png')">
        </div>
    </div>
</div>
<div class="bord">
    <div class="title">盒子模型</div>
    <div class="introduce">
        <p class="slxg">margin代码:</p>
        <pre>
    &lt;div style="width: 200px;
            height: 200px;
            margin: 0 auto;
            border: 1px solid rebeccapurple"&gt;
    &lt;/div&gt;
</pre>
        <div style="width: 200px;
            height: 200px;
            margin: 0 auto;
            background-color: #252525;
            border: 1px solid rebeccapurple">
        </div>
        <p class="slxg">border代码：</p>
        <pre>
&lt;table style="width: 200px;
            height: 200px;
            margin: 0;
            border: 2px solid rebeccapurple"&gt;

&lt;/table&gt;
</pre>
        <table style="width: 200px;
            height: 200px;
            margin: 0;
            border: 10px solid rebeccapurple">

        </table>
    </div>
</div>
<div class="bord">
    <div class="title">内边距</div>
    <div class="introduce">
        <pre>
&lt;div style="width: 200px;
            height: 200px;
            margin: 0;
            padding: 40px;
            border: 1px solid rebeccapurple"&gt;
    你好世界
&lt;/div&gt;
</pre>
        <div style="width: 200px;
height: 200px;
margin: 0;
padding: 20px;
border: 1px solid rebeccapurple"></div>
        你好世界
    </div>
    </div>
</div>
</body>
</html>